<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../../assert/css/font.css" th:href="@{/assert/css/font.css}"/>
    <link rel="stylesheet" href="../../../assert/css/bootstrap.min.css" th:href="@{/assert/css/bootstrap.min.css}"/>
    <link rel="stylesheet" href="../../../assert/css/plugin/chosen/chosen.css"
          th:href="@{/assert/css/plugin/chosen/chosen.css}"/>
    <link rel="stylesheet" href="../../../assert/css/bootstrap-table.css" th:href="@{/assert/css/bootstrap-table.css}"/>
    <link rel="stylesheet" href="../../../assert/css/bootstrap-select.min.css"
          th:href="@{/assert/css/bootstrap-select.min.css}"/>
    <link href="../../../assert/css/animate.min.css" rel="stylesheet" th:href="@{/assert/css/animate.min.css}">
    <link href="../../../assert/css/plugin/toastr/toastr.min.css" rel="stylesheet"
          th:href="@{/assert/css/plugin/toastr/toastr.min.css}">
    <link href="../../../assert/css/plugin/jsTree/themes/default/style.css" rel="stylesheet"
          th:href="@{/assert/css/plugin/jsTree/themes/default/style.css}">
    <link href="../../../assert/css/loaders.css" rel="stylesheet"
          th:href="@{/assert/css/loaders.css}">
    <link rel="stylesheet" href="../../../assert/css/index.css" th:href="@{/assert/css/index.css(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"/>
    <style>
        .search_group label.control-label {
            width: 105px;
        }

        #jstreeTag {
            max-height: 544px;
        }

        .tagSModel li {
            float: left;
            padding: 3px 5px;
            background: #29cde445;
            margin-right: 10px;
            margin-top: 10px;
        }
    </style>
</head>
<body>
<a id="basePath" th:href="@{/}"></a>
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="tools_bar">
            <div class="pull-left">
                <a href="#" class="btn btn-default active" id="btnSearch" title="隐藏查询条"><i class="fa fa-filter"></i> 隐藏</a>
                <a href="#" class="btn btn-default active" id="refresh"><i class="fa fa-refresh"></i> 刷新</a>
            </div>
            <div class="search_group">
                <div class="circleBox" id="lookExpression">
                    <span class="fa fa-question-circle" style="cursor: pointer"></span>
                    <div class="circle">
                        <div class="circle_con" style="display: none;width:520px">
                            <ul>
                                <li>标签统计的计算公式：</li>
                                <li>对于业务标签：</li>
                                <li>总打标量 = 系统打标量+人工打标量-人工纠正量</li>
                                <li>系统打标量：系统最初自动打的标签数量</li>
                                <li>人工打标量：人工添加的标签数量</li>
                                <li>人工纠正量：人工删除的系统所打标签的数量</li>
                                <li>系统正确率 = （系统打标量 - 人工纠正量） / （系统打标量 +人工打标量） 100%</li>
                                <li>系统漏识率 = 人工打标量 / 总打标量*100%</li>
                                <li>对于话务小结：</li>
                                <li>总打标量：话务小结的数量</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="search on">
            <div class="search_group">
                <label class="control-label"><span class="respan">*</span>省份：</label>
                <div class="control-inline">
                    <select type="text" id="pro" value="" class="form-control search_input"></select>
                </div>
            </div>
            <div class="search_group">
                <label class="control-label"><span class="respan">*</span>通话时间：</label>
                <div class="control-inline">
                    <input placeholder="开始日期" class="form-control layer-date search_input" id="callStartTime"
                           autocomplete="off"> -
                    <input placeholder="结束日期" class="form-control layer-date search_input" id="callEndTime"
                           autocomplete="off">
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">话务小结：</label>
                <div class="control-inline">
                    <input type="text" id="tagTrafficSearch0" value="" class="form-control search_input tagName" autocomplete="off"  data-type="0">
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">系统标签：</label>
                <div class="control-inline">
                    <input type="text" id="tagTrafficSearch1" value="" class="form-control search_input tagName" autocomplete="off" data-type="1">
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">重复来电：</label>
                <div class="control-inline">
                    <select type="text" id="repeatPhone" value="" class="form-control search_input"></select>
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">满意度：</label>
                <div class="control-inline">
                    <select type="text" id="agree" value="" class="form-control search_input"></select>
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">客户星级：</label>
                <div class="control-inline">
                    <select type="text" id="customerLevel" value="" class="form-control search_input"></select>
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">客户归属地：</label>
                <div class="control-inline">
                    <select type="text" id="customerloc" value="" class="form-control search_input selectpicker" title="全部" multiple></select>
                </div>
            </div>
            <div class="search_group">
                <button id="search" class="btn  btn-primary">查询</button>
                <button id="reset" class="btn  btn-default">重置</button>
                <button id="export" class="btn  btn-default">导出</button>
            </div>
        </div>

        <table id="myTable"></table>
    </div>
</div>
<input type="text" id="tagId" class="hidden">
<input type="text" id="tagType" class="hidden">

<form action="" id="exportForm" class="hidden" method="post">
    <input type="text" id="provinceCodeE" name="provinceCode">
    <input type="text" id="sysTagIdsE" name="sysTagIds">
    <input type="text" id="telTagIdsE" name="telTagIds">
    <input type="text" id="callStartTimeE" name="callStartTime">
    <input type="text" id="callEndTimeE" name="callEndTime">
    <input type="text" id="customerLevelsE" name="customerLevels">
    <input type="text" id="reCallFlagE" name="reCallFlag">
    <input type="text" id="satisfactionE" name="satisfaction">
    <input type="text" id="citysE" name="citys">
</form>
<form action="" id="formDetail" class="hidden" target="_blank">
    <input type="text" name="tagType">
    <input type="text" name="tagPro">
    <input type="text" name="tagStartTime">
    <input type="text" name="tagEndTime">
    <input type="text" name="sysTagIds">
    <input type="text" name="sysTagNames">
    <input type="text" name="sysOperator">
    <input type="text" name="telTagIds">
    <input type="text" name="telTagNames">
    <input type="text" name="telOperator">
    <input type="text" name="reCallFlag">
    <input type="text" name="satisfaction">
    <input type="text" name="customerLevels">
    <input type="text" name="customerloc">
    <input type="text" name="tagUse">
    <input type="text" name="source">
</form>
<input type="hidden" id="tagTreeId" value="" class="form-control search_input">
<input type="hidden" id="areaTreeId" value="" class="form-control search_input">
<input type="hidden" id="tagTreeType" value="" class="form-control search_input">
<input type="hidden" id="tagProperty" value="" class="form-control search_input">
<script src="../../../assert/js/jquery.js" th:src="@{/assert/js/jquery.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/bootstrap.min.js" th:src="@{/assert/js/bootstrap.min.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/plugin/bootstrap-table/bootstrap-table.min.js"
        th:src="@{/assert/js/plugin/bootstrap-table/bootstrap-table.min.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/plugin/bootstrap-table/bootstrap-table-mobile.min.js"
        th:src="@{/assert/js/plugin/bootstrap-table/bootstrap-table-mobile.min.js}"></script>
<script src="../../../assert/js/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"
        th:src="@{/assert/js/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
<script src="../../../assert/js/bootstrap-select.js" th:src="@{/assert/js/bootstrap-select.js}"></script>
<script src="../../../assert/js/plugin/toastr/toastr.min.js"
        th:src="@{/assert/js/plugin/toastr/toastr.min.js}"></script>
<script src="../../../assert/js/base.js" th:src="@{/assert/js/base.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/jquery-ui.min.js" th:src="@{/assert/js/jquery-ui.min.js}"></script>
<script src="../../../assert/js/plugin/layer/laydate/laydate.js"
        th:src="@{/assert/js/plugin/layer/laydate/laydate.js}"></script>
<script src="../../../assert/js/changeTime.js" th:src="@{/assert/js/changeTime.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/plugin/jsTree/jstree.min.js"
        th:src="@{/assert/js/plugin/jsTree/jstree.min.js}"></script>
<script src="../../../assert/js/plugin/chosen/chosen.jquery.js"
        th:src="@{/assert/js/plugin/chosen/chosen.jquery.js}"></script>
<script src="../../../assert/js/contabs.min.js" th:src="@{/assert/js/contabs.min.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/common.js" th:src="@{/assert/js/common.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/taskCommon.js" th:src="@{/assert/js/taskCommon.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script>
    //项目名称
    var basePath = $("#basePath").attr("href");
    var resize = {
        init: function () {
            resize.me();
            $(window).resize(function () {
                resize.me();
            })
        },
        me: function () {
            var winW = $(window).width();
            var winH = $(window).height();
            $(".ibox").width(winW - 20);
            $(".ibox").height(winH - 20);
            bs.autoTableHeight($('#myTable'),winH -$(".tools_bar").height()-22-$(".search").height())
        }
    };
    var tools = {
        num: 0,
        nowSelectAudioArr: [],
        tableData: [],
        tagNameArr: [],
        tagTypeArr: [
            {
                name: "全部",
                value: ""
            }
        ],
        agreeArr: [],
        customerLevelArr:[],
        reCallFlagArr:[],
        customerlocArr:[],//用来存储归属地
        init: function () {
            tools.selectProvince();
            tools.getTag("");
            tools.getSatStatus();
            tools.getCustomer();
            tools.getReCallFlag();
            bs.dataTime('#callStartTime', '#callEndTime');
            tools.tabSearch();
            tools.search();
            tools.reset();
            tools.refresh();
            tools.enterSearch();
            tools.export();
            tools.getCustomerloc($('#pro').val());
//            tools.getNowTime();
            $("#pro").on("change", function (event, sel) {
                $(".tagName").val("").attr({"data-id": "","title":"",'data-relation':'','data-tag-id':''});
                tag.modelSelectTagArr={
                    "0":[],
                    "1":[]
                };
                tools.getCustomerloc($('#pro').val());
            });
            $("#lookExpression").hover(function () {
                $(this).find(".circle_con").show();
            }, function () {
                $(this).find(".circle_con").hide();
            })
        },
        getCustomerloc:function(provinceCode){
            tools.customerlocArr=[{"name":"请选择","value":""}];
            if(provinceCode == ''){
                bs.selectBootStrap($("#customerloc"), tools.customerlocArr);
            }else{
                $.ajax({
                    type: "POST",
                    url: basePath + 'rest/common/getProvinceCity',
                    dataType: "json",
                    contentType: 'application/json',
                    data: JSON.stringify({"provinceCode":provinceCode}),
                    async: false,
                    success: function (data) {
                        var result = data.data;
                        var arr=[{"name":"请选择","value":""}];
                        if(provinceCode!==""){
                            for(var key in result){
                                var obj={};
                                obj.name=result[key];
                                obj.value=key ;
                                arr.push(obj);
                            }
                            tools.customerlocArr=arr;
                            bs.selectBootStrap($("#customerloc"), tools.customerlocArr);
                        }
                    }
                });
            }

        },
        getReCallFlag:function(){
            var dataArr = bs.getStatus("recall_flag");
            Object.assign(tools.reCallFlagArr,dataArr);//es6复制数组的方法
            tools.reCallFlagArr.shift();
            tools.reCallFlagArr.unshift({
                name:"请选择",
                value:""
            });
            bs.selectDown($("#repeatPhone"), tools.reCallFlagArr);
        },
        getCustomer: function () {
            tools.customerLevelArr= bs.getStatus("audio_customer_level");
            tools.customerLevelArr.shift();
            tools.customerLevelArr.unshift({
                name:"请选择",
                value:""
            });
            bs.selectDown($("#customerLevel"), tools.customerLevelArr);
        },
        getSatStatus:function(){
            var dataArr = bs.getStatus("audio_satisfaction");
            Object.assign(tools.agreeArr,dataArr);//es6复制数组的方法
            tools.agreeArr.shift();
            tools.agreeArr.unshift({
                name:"请选择",
                value:""
            });
            bs.selectDown($("#agree"), tools.agreeArr);
        },
        getTag: function (id) {
            tools.tagNameArr = [
                {
                    name: "全部",
                    value: ""
                }
            ];
            $.ajax({
                type: "post",
                url: basePath + "/rest/busTag/selectAllBusTag",
                dataType: "json",
                async: false,
                data: {
                    areaId: id
                },
                success: function (data) {
                    if (data.length > 0) {
                        var dataArr = data;
                        for (var i = 0; i < dataArr.length; i++) {
                            var obj = {};
                            obj.name = dataArr[i].name;
                            obj.value = dataArr[i].id;
                            tools.tagNameArr.push(obj);
                        }
                    }
                }
            });
        },
        selectProvince: function () {
            tools.proArr = bs.getProvince();
            tools.proArr.shift();
            tools.proArr.unshift({"name": "请选择", "value": "-1"})
            bs.selectDown($("#pro"), tools.proArr, "");
            if ($("#spanId", parent.document).attr("data-procode") != "") {
                if (tools.proArr.length == 2) {
                    $("#pro").val(tools.proArr[1].value).prop("disabled", true).trigger("chosen:updated");
                }
            }
        },
        changeState: function (value, arr) {
            var str = "";
            for (var i = 0; i < arr.length; i++) {
                if (value == arr[i].value) {
                    str = arr[i].name
                }
            }
            return str;
        },
        tabSearch: function () {
            var search = $(".search");
            $("#btnSearch").on("click", function () {
                if (search.hasClass("on")) {
                    search.slideUp();
                    search.removeClass("on");
                    $("#btnSearch").html('<i class="fa fa-filter"></i> 查询').attr("title", "显示查询条");
                } else {
                    search.slideDown();
                    search.addClass("on");
                    $("#btnSearch").html('<i class="fa fa-filter"></i> 隐藏').attr("title", "隐藏查询条");
                }

            });
        },
        search: function () {
            $("#search").on("click", function () {
                if ($("#tagName").val() == "") {
                    $("#tagType").val("");
                }
                var res = tools.searchValidate();
                if (res) {
                    var loadHtml=$('<div class="loaded" style="margin:0 auto">' +
                    '<div class="loader">' +
                    '<div class="loader-inner line-scale-pulse-out">' +
                    '<div></div>' +
                    '<div></div>' +
                    '<div></div>' +
                    '<div></div>' +
                    '<div></div>' +
                    '</div>' +
                    '</div>' +
                    '</div>' +
                    '<div>请稍等，数据正在加载中...</div>');
                    $("#myTable tbody tr").remove();
                    $("#myTable tbody").append('<tr class="no-records-found"><td style="width:100%" colspan="10"></td></tr>');
                    $("#myTable tbody td").html(loadHtml);
                    getDate.init();
                }
            })
        },
        searchValidate: function () {
            var res = false;
            if ($("#pro").val() == "-1") {
                toastrCog.error("请选择省份！", 3000)
            } else if ($("#callStartTime").val() == "") {
                toastrCog.error("请选择通话开始时间！", 3000)
            } else if ($("#callEndTime").val() == "") {
                toastrCog.error("请选择通话结束时间！", 3000)
            } else {
                res = true;
            }
            return res;

        },
        tableRefresh: function () {
            if (tools.num == 0) {
                var oTable = new TableInit();
                oTable.Init();
            } else {
                $("#myTable").bootstrapTable('refreshOptions', {pageNumber: 1});
                $("#myTable").bootstrapTable('refresh');
            }
            tools.num++;
        },
        reset: function () {
            $("#reset").on("click", function () {
                bs.resetSearch($(".search"));
                if($("#laydate_box").length>0){
                    bs.resetTimeElems("#callStartTime","#callEndTime");
                }
                tag.clearTag();
                if ($("#spanId", parent.document).attr("data-procode") == "") {
                    $("#pro").val("-1").trigger("chosen:updated");
                }
                tools.getCustomerloc($("#pro").val());
                var oTable = new TableInitOne();
                oTable.Init();
                tools.num = 0;
                tools.tableData=[];
            })
        },
        resetSelect: function ($obj) {
            $obj.val("");
            $obj.trigger("chosen:updated");
        },
        refresh: function () {
            $("#refresh").on("click", function () {
                $("#search").click();
            })
        },
        enterSearch: function () {
            $(".search").on("keyup", function (e) {
                var code = e.charCode || e.keyCode;
                if (code == 13) {
                    //此处编写用户敲回车后的代码
                    $("#search").click();
                }
            })
        },
        export: function () {
            $("#export").on("click", function () {
                if (tools.tableData.length<=0) {
                    toastrCog.error("没有可导出的数据哦！", 3000)
                    return;
                }
                var form = $("#exportForm");
                form.attr("action", basePath + "/rest/phone-statistics/export-tag-mes");
                $("#provinceCodeE").val($("#pro").val());
                $("#callStartTimeE").val($("#callStartTime").val());
                $("#callEndTimeE").val($("#callEndTime").val());
                $("#sysTagIdsE").val($("#tagTrafficSearch1").attr('data-tag-id'));
                $("#telTagIdsE").val($("#tagTrafficSearch0").attr('data-tag-id'));
                $("#customerLevelsE").val($("#customerLevel").val());
                $("#reCallFlagE").val($("#repeatPhone").val());
                $("#satisfactionE").val($("#agree").val());
                $("#citysE").val(bs.filterSelectVal($("#customerloc")));
                form[0].submit();
            })

        },
        getNowTime: function () {
            var endTime = dateFormatUtil(new Date().getTime());
            var str = endTime.split(" ")[0];
            var startTime = str.substr(0, str.length - 2) + "01" + " " + "00:00:00";
            $("#callStartTime").val(startTime);
            $("#callEndTime").val(endTime);
        },
        jumpDetail:function(row){
            var form=$("#formDetail");
            var provinceCodeC = $("#pro").val();
            var callStartTimeC = $("#callStartTime").val();
            var callEndTimeC = $("#callEndTime").val();
            var reCallFlagC = $("#repeatPhone").val();
            var satisfactionC = $("#agree").val();
            var customerLevelsC = $("#customerLevel").val();
            var customerlocC = $("#customerloc").val();
            form.find("input[name='tagPro']").val(provinceCodeC);
            form.find("input[name='tagStartTime']").val(callStartTimeC);
            form.find("input[name='tagEndTime']").val(callEndTimeC);
            form.find("input[name='reCallFlag']").val(reCallFlagC);
            form.find("input[name='satisfaction']").val(satisfactionC);
            form.find("input[name='customerLevels']").val(customerLevelsC);
            form.find("input[name='customerloc']").val(customerlocC);
            form.find("input[name='source']").val('tag');
            var tagType=row.tagType;
            var tagName=row.tagName;
            var tagId=row.tagId;
            if(tagName == '-'){
                tagName='全部'
            }
            if(!tagId){
                tagId = '全部'
            }
            if(tagType=="1,2"){//系统标签
                form.find("input[name='telTagIds']").val("");
                form.find("input[name='telTagNames']").val("");
                form.find("input[name='telOperator']").val('');
                form.find("input[name='sysTagIds']").val(tagName);
                form.find("input[name='sysTagNames']").val(tagName);
                form.find("input[name='sysOperator']").val('0');
            }else{//话务小节
                form.find("input[name='sysTagIds']").val("");
                form.find("input[name='sysTagNames']").val("");
                form.find("input[name='sysOperator']").val('');
                form.find("input[name='telTagIds']").val(tagName);
                form.find("input[name='telTagNames']").val(tagName);
                form.find("input[name='telOperator']").val('0');
            }
        },
        jumpFormatter:function(value, row, code, txt){
            tools.jumpDetail(row);
            $("#formDetail").find("input[name='tagType']").val(code);
            var params=$("#formDetail").serialize();
            // var href=basePath + "/rest/page/audioRetrieval?"+params;
            var href=basePath + "/rest/page/tagMarkList?"+params;
            if(value!=0){
                return '<a href="'+href+'" title="查看语音详情"  class="J_menuItem" data-index="tag'+txt+'"  data-txt="标签统计-'+txt+'" data-href="/rest/page/tagMarkList">'+value+'</a>'
            }else{
                return value+""
            }
        }

    };
    var TableInit = function () {
        var oTableInit = new Object();
        var height = ($(window).height() -$(".tools_bar").height()-9-$(".search").height()-40);
        //初始化Table
        oTableInit.Init = function (json) {
            $('#myTable').bootstrapTable('destroy');
            $('#myTable').bootstrapTable({
                data:json,
                cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                height:height,
                pagination: true,                   //是否显示分页（*）
                sidePagination: "client",           //分页方式：client客户端分页，server服务端分页（*）
                pageNumber: 1,                       //初始化加载第一页，默认第一页
                pageSize: 10,                       //每页的记录行数（*）
                pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                search: false,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                contentType: "application/x-www-form-urlencoded",
                strictSearch: true,
                showColumns: false,                  //是否显示所有的列
                showRefresh: false,                  //是否显示刷新按钮
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
//                uniqueId: "serialNumber",                     //每一行的唯一标识，一般为主键列
                showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
                cardView: false,                    //是否显示详细视图
                detailView: false,
                cellStyle: {
                    css: {"background-color": "#fff"}
                },//是否显示父子表
                columns: [
//                    {
//                        checkbox: true, // 显示一个勾选框
//                        align: 'center' // 居中显示
//                    },
                    {
                        align: "center",
                        halign: "center",
                        title: '序号',//标题  可不加
                        width: 60,
                        formatter: function (value, row, index) {
                            var getOptions = $("#myTable").bootstrapTable('getOptions');
                            return (index + 1) + "";
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'provinceCode',
                        title: '省份',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return bs.getXInY(tools.proArr,"name","value",value);
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'tagType',
                        title: '标签属性',
                        sortable: true,
                        formatter: function (value, row, index) {
                            var  str = "系统标签";
                            if(value == "0"){
                                str="话务小结"
                            }
                            return str;
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'tagName',
                        title: '标签/话务小结',
                        sortable: true
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'tagCount',
                        title: '总打标量',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return tools.jumpFormatter(value, row, 'allTag', '总打标量')
                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'sysTagCount',
                        title: '系统打标量',
                        formatter: function (value, row, index) {
                            return tools.jumpFormatter(value, row, 'sysTag', '系统打标量')
                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'addTagCount',
                        title: '人工打标量',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return tools.jumpFormatter(value, row, 'addTag', '人工打标量')
                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'corTagCount',
                        title: '人工纠正量',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return tools.jumpFormatter(value, row, 'corTag', '人工纠正量')
                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'accuracy',
                        title: '系统正确率',
                        sortable: true
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'leakage',
                        title: '系统漏识率',
                        sortable: true
                    }
                ],
                onLoadSuccess: function (data) {  //加载成功时执行
                    resize.me();
                    if (!data.rows || data.rows.length == 0) {
                        var src = basePath + "/assert/image/nodata.png";
                        $(".no-records-found").find("td").html('<img src="' + src + '" th:src="@{/assert/image/nodata.png}" style="width:165px;" alt="">');
                    }
                },
                onLoadError: function () {  //加载失败时执行
                    var src = basePath + "/assert/image/nodata.png";
                    $(".no-records-found").find("td").html('<img src="' + src + '" th:src="@{/assert/image/nodata.png}" style="width:165px;" alt="">');
                },
                formatLoadingMessage: function () {
                    return '<div class="loaded">' +
                        '<div class="loader">' +
                        '<div class="loader-inner line-scale-pulse-out">' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '</div>' +
                        '</div>' +
                        '</div>' +
                        '<div>请稍等，数据正在加载中...</div>';
                }
            });
        };
        //得到查询的参数
        oTableInit.queryParams = function (params) {
            var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                pageNum: params.offset / params.limit,   //页面大小
                pageSize: params.limit,
                provinceCode: $("#pro").val(),
                callStartTime: $("#callStartTime").val(),
                callEndTime: $("#callEndTime").val(),
                sysTagIds: $("#tagTrafficSearch1").attr('data-tag-id'),
                telTagIds: $("#tagTrafficSearch0").attr('data-tag-id'),
                satisfaction:$("#agree").val(),
                customerLevels:$("#customerLevel").val(),
                reCallFlag:$("#repeatPhone").val()
            };
            return temp;
        };
        return oTableInit;
    };
    var TableInitOne = function () {
        var oTableInit = new Object();
        //初始化Table
        oTableInit.Init = function () {
            $('#myTable').bootstrapTable('destroy');
            $('#myTable').bootstrapTable({
//                toolbar: '#tools_bar',                //工具按钮用哪个容器
                data: [],
                cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                pagination: true,                   //是否显示分页（*）
                sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                pageNumber: 1,                       //初始化加载第一页，默认第一页
                pageSize: 10,                       //每页的记录行数（*）
                pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                search: false,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                contentType: "application/x-www-form-urlencoded",
                strictSearch: true,
                showColumns: false,                  //是否显示所有的列
                showRefresh: false,                  //是否显示刷新按钮
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
//                uniqueId: "serialNumber",                     //每一行的唯一标识，一般为主键列
                showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
                cardView: false,                    //是否显示详细视图
                detailView: false,
                cellStyle: {
                    css: {"background-color": "#fff"}
                },//是否显示父子表
                columns: [
                    {
                        align: "center",
                        halign: "center",
                        title: '序号',//标题  可不加
                        width: 60,
                        formatter: function (value, row, index) {
                            var getOptions = $("#myTable").bootstrapTable('getOptions');
                            var pagenum = getOptions.pageNumber;
                            var pagesize = getOptions.pageSize;
                            var st = (pagenum - 1) * pagesize;
                            return (st + index + 1) + "";
                        }
                    },
                    {
                        align: "left",
                        halign: "center",
                        field: 'provinceCode',
                        title: '省份',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return bs.filterData(bs.getXInY(tools.proArr,"name","value",value));
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'proType',
                        title: '标签属性',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return bs.filterData(bs.changeState(value, tools.tagProArr));
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'tagType',
                        title: '标签/话务小结',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return bs.filterData(value);
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'tagCount',
                        title: '总打标量',
                        sortable: true
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'corTagCount',
                        title: '系统打标量'
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'accuracy',
                        title: '人工打标量',
                        sortable: true
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'leakage',
                        title: '人工纠正量',
                        sortable: true
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'leakage',
                        title: '系统正确率',
                        sortable: true
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'leakage',
                        title: '系统漏识率',
                        sortable: true
                    }
                ],
                onPostBody: function () {
                    $(".no-records-found").find("td").html("<div style='height:50px;line-height: 50px;'>亲，请选择必选条件哦！</div>")
                }
            });
        };
        return oTableInit;
    };
    var getDate={
        init:function(){
            $.ajax({
                type: "POST",
                url:basePath + "rest/phone-statistics/get-tag-count",
                dataType: "json",
//                contentType: 'application/json',
                data:{   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                    provinceCode: $("#pro").val(),
                    callStartTime: $("#callStartTime").val(),
                    callEndTime: $("#callEndTime").val(),
                    sysTagIds: $("#tagTrafficSearch1").attr('data-tag-id'),
                    telTagIds: $("#tagTrafficSearch0").attr('data-tag-id'),
                    satisfaction:$("#agree").val(),
                    customerLevels:$("#customerLevel").val(),
                    reCallFlag:$("#repeatPhone").val(),
                    citys:bs.filterSelectVal($("#customerloc"))
                },
                success: function (data) {
                    var code=data.code;
                    if (code ==0) {
                        var result=data.data;
                        var oTable = new TableInit();
                        oTable.Init(result);
                        tools.tableData=result;
                    }
                }
            });
        }
    };
    $(function () {
        tools.init();
        var oTable = new TableInitOne();
        oTable.Init();
        tag.init($('#pro'),'Search','0',null,true);// true代表不显示关系
        resize.init();
    })
</script>
</body>
</html>